#pragma once
#include <memory>
#include <string>
#include <iostream>
#include <algorithm>
#include <type_traits>

class ATest
{
public:
	ATest()
	{
		std::cout << "construct call" << std::endl;
	}

	ATest(const std::string &str)
		:name(str)
	{
		std::cout << "construct call" << std::endl;
	}

	~ATest()
	{
		std::cout << "destory call" << std::endl;
	}

private:
	std::string name;
};

void memory_test() {
	std::allocator<ATest> a;
	auto p = a.allocate(sizeof ATest);
	std::allocator_traits<std::allocator<ATest>>::construct(a, std::to_address(p),"aaaaa");
	std::allocator_traits<std::allocator<ATest>>::destroy(a, std::to_address(p));
	a.deallocate(p, sizeof ATest);
}
